let MyPlugin = {};
MyPlugin.install = (Vue, options) => {
    // 1. 添加全局方法或属性
    Vue.myGlobalMethod = function () {
        
    }

    // 2. 添加全局资源
    Vue.directive('my-directive', {
        bind(el, binding, vnode, oldVnode) {
        }
    })

    // 3. 注入组件
    Vue.mixin({
        created: function () {

        }
    })

    // 4. 添加实例方法
    Vue.prototype.setCookie = function (name, value, days) {
        var d = new Date
        d.setTime(d.getTime() + 24 * 60 * 60 * 1000 * days)
        window.document.cookie = name + "=" + value + ";path=/;expire=" + d.toGMTString();
    }

    Vue.prototype.getCookie = function (name) {
        var v = window.document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
        return v ? v[2] : null
    }

    Vue.prototype.delectCookie = function (name) {
        this.set(name,"",-1)
    }
   
}
export default MyPlugin